package javaBase.nowcoder.HJ92_A_在字符串中找出连续最长的数字串;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = br.readLine()) != null) {
            char[] c = s.toCharArray();
            int max_len = 0;
            String result = "";
            for (int i = 0; i < c.length; i++) {
                if (Character.isDigit(c[i])) {
                    int end = i;
                    while (end < c.length && Character.isDigit(c[end])) {
                        end++;
                    }
                    int len = end - i;
                    if (len > max_len) {
                        max_len = len;
                        result = s.substring(i, end);
                    } else if (len == max_len) {
                        result += s.substring(i, end);
                    }
                }
            }
            System.out.println(result + "," + max_len);
        }
    }
}